Can I connect my SMS Gateway to Nagios or Icinga 1?

 

 

You can of course use your SMS Gateway to send alarms from Nagios or Icinga 1 via SMS.

 

 

ê It is recommended to create a new user for the script usage. The script uses the HTTP-API of the SMS Gateway.

 

 

 

Download-links:

https://github.com/NETWAYS/notify-brevisone

https://github.com/NETWAYS/notify-brevisone/releases/tag/v0.1.0

 

 

1. Download and configure the necessary script

 

For this purpose, you first need the script sendsms.sh.

 

Download it and place it on your Nagios server in the /usr/local/bin/ directory.

 

Create a file "config" in the directory /usr/local/bin/. This file contains the configuration for the script.

 

 

username=<myuser>

 

password=<mypassword>

 

host=<IP Address of the SMS Gateways>

 

#mode=<All modes can be seen here>

 

#insecuressl=true

 

#proxy=[protocol://][user:password@]proxyhost[:port]

 

 

 

2. Configure Nagios

 

In this step commands must now be configured for the SMS configuration in Nagios. Corresponding contacts must also be created.

 

1. Example: Definition for SMS notifications in /etc/nagios3/commands.cfg

 

define command

{

command_name notify-host-by-sms

command_line /usr/local/bin/sendsms.sh $CONTACTPAGER$ "$NOTIFICATIONTYPE$ - Host $HOSTALIAS$ is $HOSTSTATE$ since $SHORTDATETIME$ info: $HOSTOUTPUT$"

}

 

 

 

define command

{

command_name notify-service-by-sms

command_line /usr/local/bin/sendsms.sh $CONTACTPAGER$ "$NOTIFICATIONTYPE$ - $SERVICEDESC$ on $HOSTNAME$ state: $SERVICESTATE$ since $SHORTDATETIME$ info: $SERVICEOUTPUT$"

}

 

 

 

2. Example: Definition for a contact in /etc/nagios3/contacts.cfg

 

define contact

{

contact_name Max_Muster

alias Max Muster

host_notification_period 24x7

service_notification_period 24x7

host_notification_options d,u,r

service_notification_options u,c,r

pager 00491701234567

host_notification_commands notify-host-by-sms

service_notification_commands notify-service-by-sms

 

}

 

 

 

 

 

 

Related articles